<!--js date picker-->
<link href="<?php echo base_url(); ?>./css/css_datepicker/jquery.ui.all.css" rel="stylesheet" type="text/css" />  
<script type="text/javascript" src="<?php echo base_url(); ?>jscripts/js_datepicker/jquery-1.7.2.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>jscripts/js_datepicker/jquery.ui.core.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>jscripts/js_datepicker/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>jscripts/js_datepicker/jquery.ui.widget.js"></script>

<!--end js date picker-->
<script language="javascript" type="text/javascript">
    $(function() {
        $( ".datepicker" ).datepicker({
            changeMonth: true,
            changeYear: true,
            dateFormat: 'yy:mm:dd' 
        });
    });
           
</script>
<style type="text/css">
    p{ color: red; font-size: 12px;}
    span{color:red;}
</style>
<div class="task1">
    <?php
    echo form_open('card/add', array('name' => 'frmadd', 'onsubmit' => 'return check_user()', 'method' => 'post'));
    echo '<div class="form-wrapper" style="width:95%;padding:10px; borde:0px solid #000;margin:0 auto;">';
    echo '<fieldset style="margin: 0 auto;width:auto;height: auto;border: 1px #ccc solid; padding:20px 15px 20px 15px;-moz-border-radius:10px;">';
    echo '<legend align="center"><div class="heading" style="color:#4F815C;font-size:24px;">Add new card</div></legend>';
    echo ' <div style="float: right;width:auto;height: auto; margin-top: -16px;">' . anchor("card/manager", img("images/user_images/cancel.png")) . '</div>';
    if ($this->session->userdata('ms_error')) {
        echo message($this->session->userdata('ms_error'), "error");
        $this->session->unset_userdata("ms_error");
    }
    echo '<table  align="center" width="auto">';

    echo '<tr>';
    echo '<td valign="top">CardName<span>*</span></td>';
    echo '<td>' . form_input(array('name' => 'txt_cardname', 'value' => $this->input->post("txt_cardname") ? $this->input->post("txt_cardname") : " ")) . form_error('txt_cardname') . '</td>';
    echo '</tr>';
    /*  echo '<tr>';
      echo '<td valign="top">CardType<span>*</span></td>';
      echo '<td valign="top">';
      ?> <select name="card_type">
      <option value="">-Select Card Type-</option>
      <?php
      $this->db->select('*');
      $selectdata = $this->db->get('tbl_car_type');
      foreach ($selectdata->result() as $rows) {
      echo'<option value="' . $rows->car_type_id . '">' . $rows->car_type_name . '</option>';
      }
      ?>
      </select>
      <?php
      echo form_error('card_type');
      echo '</td>';

      echo '</tr>';
     */
    echo '<tr>';
    $this->db->select('*');
    $selectdata = $this->db->get('tbl_car_type');
    $select[' '] = '--Select student--';
    foreach ($selectdata->result() as $row) {
        $select[$row->car_type_id] = $row->car_type_name;
    }
    echo '<td>CardType<span>*</span></td>';
    echo '<td>';
    echo form_dropdown("card_type", $select, $this->input->post("card_type") ? $this->input->post("card_type") : " ");
    echo '</td>';
    echo '</tr>';
    /* =======================end add student name=============== */

    echo '<tr>';
    echo '<td valign="top">PriceKhmer<span>*</span></td>';
    echo '<td>' . form_input(array('name' => 'txt_k', 'value' => $this->input->post("txt_k") ? $this->input->post("txt_k") : " ")) . form_error('txt_k') . '</td>';

    echo '</tr>';
    echo '<tr>';
    echo '<td valign="top">PriceVolunteer<span>*</span></td>';
    echo '<td>' . form_input(array('name' => 'txt_v', 'value' => $this->input->post("txt_v") ? $this->input->post("txt_v") : " ")) . form_error('txt_v') . '</td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td valign="top">Price Other<span>*</span></td>';
    echo '<td>' . form_input(array('name' => 'txt_tcm', 'value' => $this->input->post("txt_tcm") ? $this->input->post("txt_tcm") : " ")) . form_error('txt_tcm') . '</td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td valign="top">Quantity<span>*</span></td>';
    echo '<td>' . form_input(array('name' => 'txt_quantity', 'value' => $this->input->post("txt_quantity") ? $this->input->post("txt_quantity") : " ")) . form_error('txt_quantity') . '</td>';
    echo '</tr>';

    echo '<tr>';
    echo '<td>Description</td>';
    echo '<td>' . form_textarea(array('name' => 'txtdetail', 'cols' => '50', 'rows' => '8', 'value' => $this->input->post("txtdetail") ? $this->input->post("txtdetail") : " ")) . '</td>';
    echo '</tr>';
    echo '<tr>';
    echo '<td></td>';
    echo '<td>' . form_submit('btn_submit', 'Add') . form_reset('btn_reset', 'Reset') . '</td>';
    echo '</tr>';
    echo '</table>';
    echo '<p>Note : (*) must be insert!</p>';
    echo '</fieldset>';
    echo '</div>';
    echo form_close();
    ?>
</div>
